/**
 * @author 20120102 by hzx
 * @class ChangePassPanel
 * @extends Ext.grid.GridPanel
 * @description 修改密码panel
 */
ChangePassPanel = Ext.extend(ChangePassForm, {
	
	// 构造方法
	constructor : function(_config) {
		if (_config == null) {
			_config = {};
		}
		Ext.apply(this, _config);
		// 拷贝父类的构造方法到当前对象
		ChangePassPanel.superclass.constructor.call(this, {
					bbar : [{
								text : "确认修改",
								iconCls : "houfei-addicon",
								handler : this.onChangePass,
								scope : this
							}]
				});

	},

	/**
	 * 确认按钮单击事件
	 */
	 onChangePass : function() {
		if (this.getForm().isValid() == true) {
			var _values = this.getForm().getValues();
			this.submitChangePass();
		}
	},
	/**
	 * 取消按钮单击事件
	 */
	onCancelAddBatchSms : function() {
		this.getForm().reset();
	},

	/**
	 * 提交表单
	 */
	 submitChangePass : function() {
		this.getForm().submit({
					url : "userInfoSms.do",
					method : "post",
					waitTitle : "数据传输",
					waitMsg : "数据传输中,请稍候......",
					success : this.onInsertSuccess,
					failure : this.onInsertFailure,
					scope : this,
					params : {
						operator : "changePass"
					}
				});
	},

	/**
	 * 添加成功事件
	 * 
	 * @param {}
	 *            _form
	 * @param {}
	 *            _response
	 */
	onInsertSuccess : function(_form, _action) {
		//Ext.Msg.alert("系统消息", "修改成功!");
		//sleep(2000);
		Ext.Msg.confirm("系统消息", "修改成功,您的个人登录信息已注销,重新登录？",
				function(_btn){
			if(_btn == "yes")
				window.location.href = _action.result["succMsg"]; 
		}, this);
		
		//window.location.href = "/sms/index.jsp"; 
	},

	/**
	 * 添加失败事件
	 * 
	 * @param {}
	 *            _form
	 * @param {}
	 *            _response
	 */
	onInsertFailure : function(_form, _action) {
		Ext.Msg.alert("系统消息", _action.result["errorMsg"]);
	}
});